﻿<%@ Page Title="Brands" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master" AutoEventWireup="true" CodeBehind="EditBrand.aspx.cs" Inherits="WebUI.EditPages.EditBrand" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">
    <script type="text/javascript">
        function onRemove() {
            return confirm("Are you sure to delete selected item?");
        }

        function onAddBrand() {
            var returnValue = window.showModalDialog('<%=GetEditBrandNamePageLink() %>' + '&mode=new', '', 'dialogWidth=500px;dialogHeight=200px;resizable=no;help=no;unadorned=yes;');
            return returnValue > 0;
        }

        function onEditBrand() {
            var lst = document.getElementById("<%=lstBrand.ClientID %>");

            if (lst.selectedIndex < 0) {
                alert('Please select an item!');
                return false;
            }
            var id = lst.options[lst.selectedIndex].value;
            var returnValue = window.showModalDialog('<%=GetEditBrandNamePageLink() %>' + '&id=' + id + '&mode=edit', '', 'dialogWidth=500px;dialogHeight=200px;resizable=no;help=no;unadorned=yes;');
            return returnValue > 0;
        }
    </script>
    <table class="toolbar" width="100%">
        <tr>
            <td style="vertical-align:middle; text-align:left">
                <asp:LinkButton class="tbbutton" ID="btnAdd" runat="server" OnClientClick="return onAddBrand();" OnClick="btnAddBrand_OnClick" >
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/AddRecord.gif" /><asp:Label
                        ID="label1" runat="server" Text="Add"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnEdit" runat="server" OnClientClick="return onEditBrand();" OnClick="btnAddBrand_OnClick" >
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/Edit.gif" /><asp:Label
                        ID="label3" runat="server" Text="Edit"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnDelete" OnClientClick="return onRemove();" runat="server" OnClick="btnDeleteBrand_OnClick">
                    <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/Delete.gif" /><asp:Label
                        ID="label2" runat="server" Text="Delete" ToolTip="Delete selected brands" ></asp:Label>
                </asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
    <asp:ListBox SelectionMode="Single" ID="lstBrand" runat="server" Width="100%" Height="400px"  ></asp:ListBox>
</asp:Content>
